package com.fusetech.flow.audit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fusetech.flow.audit.domain.AuditProcessAuditorRoleUser;
import com.fusetech.flow.audit.mapper.AuditProcessAuditorRoleUserMapper;
import com.fusetech.flow.audit.service.dto.AuditProcessAuditorRoleUserDTO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * 审核流程对应角色Service
 * @author xx
 * @version 2023-05-06
 */
//@DS("zxhy_platform_db")
@Service
@Transactional
public class AuditProcessAuditorRoleUserService extends ServiceImpl<AuditProcessAuditorRoleUserMapper, AuditProcessAuditorRoleUser> {

	/**
	 * 根据id查询
	 * @param id
	 * @return
	 */
	public AuditProcessAuditorRoleUserDTO findById(String id) {
		return baseMapper.findById ( id );
	}

	/**
	 * 自定义分页检索
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	public IPage <AuditProcessAuditorRoleUserDTO> findPage(Page <AuditProcessAuditorRoleUserDTO> page, QueryWrapper queryWrapper) {
		queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
		return  baseMapper.findList(page, queryWrapper);
	}

	public int deleteAPAuditorRoleUserByProcessID(String id)
	{
		return baseMapper.deleteAuditProcessAuditorRoleUserByProcessID(id);
	}
}
